<!DOCTYPE html>
<html lang="en">
<script src="../static/angularjs/angular.min.js"></script>
<script src="../static/layer/layer.js"></script>
<script src="../static/jQuery/jquery-2.2.3.min.js"></script>
<html>
<head>
    <meta charset="UTF-8">
    <title>订单</title>
</head>
<script>
    window.onload = findAll;

    function findAll() {
        $.get("/fabu/list", null, function (date) {
            $.each(date, function (i, n) {
                $("#is").append(n.id);
                $("#bringaddressid").append(n.bringaddressid);
                $("#id").append(n.id);
                $("#takeaddressid").append(n.takeaddressid);
                $("#bringlocation").append(n.bringlocation);
                $("#status").append(n.status);
                $("#goodstype").append(n.goodstype);
                $("#goodsweight").append(n.goodsweight);
                $("#goodsnum").append(n.goodsnum);
                $("#expecttime").append(n.expecttime);


            });
        }, "json");


    }

    function layeropen() {
        // $.post("address/update")

        //弹出层
        layer.open({
            type: 1,
            area: ['500px', '600px'],
            title: '地址修改'
            , content: $("#test"),
            shade: 0,
            btn: ['修改', '取消 ']
            , btn1: function (index, layero) {
                var kk = $("#username").val();
                alert(kk);
                return true;
            },
            btn2: function (index, layero) {
                alert("是否取消修改");
                return true;
            },
            cancel: function (layero, index) {
                layer.closeAll();
            }

        });

    }


    function update() {
        //通过类选择器获得id值
        console.log($(".idclass").attr("id"));
        $.post("/fabu/update/" + $(".idclass").attr("id"), function (date) {
            // console.log(date);
            pop_upLayer;
        }, "html");
    }
</script>
<body ng-app="orderApp" ng-controller="orderController">
<div>
    <button hidden type="button" onclick="findAll()"></button>
    <div>
        <table id="content">
            <tr>
                <td>送货地址&nbsp;&nbsp;</td>
                <td>取货地址&nbsp;&nbsp;</td>
                <td>距离&nbsp;&nbsp;</td>
                <td>订单状态&nbsp;&nbsp;</td>
                <td>订单类型&nbsp;&nbsp;</td>
                <td>配送重量&nbsp;&nbsp;</td>
                <td>配送数量&nbsp;&nbsp;</td>
                <td>送达时间&nbsp;&nbsp;</td>
            </tr>

            <tr>
                <td id="bringaddressid">&nbsp;</td>
                <td id="takeaddressid+">&nbsp;</td>
                <td id="bringlocation">&nbsp;</td>
                <td id="status">&nbsp;</td>
                <td id="goodstype">&nbsp;</td>
                <td id="goodsweight">&nbsp;</td>
                <td id="goodsnum">&nbsp;</td>
                <td id="expecttime">&nbsp;</td>
                <td id="up"><input id="1" class="idclass" type="button" value="修改" onclick="update()"/></td>
                <td id="del"><input id="0" class="idclass" type="button" value="删除" onclick="delete()"/></td>
            </tr>
        </table>
    </div>

    <div>
        <div>
            <form class="layui-form" id="test" style="display:none">
                <div class="layui-form-item">
                    <label class="layui-form-label">学号</label>
                    <div class="layui-input-block">
                        <input type="text" name="collegeLcationid" ng-model="schoolID" required lay-verify="required"
                               placeholder="请输入标题"
                               autocomplete="on"
                               class="layui-input" style="width:100px">
                    </div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">地址</label>
                    <div class="layui-input-inline">
                        <input type="text" name="address" ng-model="address" required lay-verify="required"
                               placeholder=""
                               autocomplete="on"
                               class="layui-input">

                    </div>
                </div>

                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">姓名</label>
                    <div class="layui-input-block">
                        <input type="text" name="name" ng-model="username" placeholder="请输入内容" class="layui-textarea"/>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">手机号</label>
                    <div class="layui-input-inline">
                        <input type="text" name="module" ng-model="phone" required lay-verify="required"
                               placeholder="请输入手机号" autocomplete="on"
                               class="layui-input">
                    </div>
                </div>
            </form>
            <input type="button" value="弹出层" onclick="layeropen()"/>
        </div>
    </div>
</div>

</body>
</html>